package controller

import (
	"github.com/gin-gonic/gin"
	"niu-video/app/model"
	"niu-video/app/service"
	"niu-video/pkg/response"
	"niu-video/pkg/validate"
)

type LikeController struct {
}

// Like 点赞
func (ctrl *LikeController) Like(c *gin.Context) {

	request := model.LikeAction{}
	if ok := validate.Validate(c, &request); !ok {
		return
	}
	userId := c.GetInt64("current_user_id")
	msg := service.LikeService.Like(request, userId)
	response.OkWithMessage(msg, c)
}
